package model

import (
	"github.com/crack007/go-im/pb"
	"time"
)

type SentinelModel struct {
	Id            string
	Ip            string
	Port          uint16
	IsLeader      bool
	Client        pb.SentinelServiceClient // 和对应sentinel创建的连接
	LastConnected int64                    // 最后通信时间
	Epoch         uint64                   // 配置纪元id
}

func NewSentinelModel() *SentinelModel {
	return &SentinelModel{}
}
func (m *SentinelModel) RefreshLastConnected() {
	m.LastConnected = time.Now().Unix()
}
